﻿<UserControl x:Class="Dotway.WPF.Samples.DotwaySampleApplication.PixelateEffectSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:effects="clr-namespace:Dotway.WPF.Effects;assembly=Dotway.WPF.Effects">
    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0" Text="A pixel shader effect that will pixelate the GUI." HorizontalAlignment="Center"/>

        <StackPanel Grid.Row="1" Margin="5" HorizontalAlignment="Center">
            <TextBlock Text="Number of horizontal blocks:" />
            <Slider Minimum="1" Maximum="600" Value="{Binding ElementName=pixelateEffect, Path=HorizontalBlockCount}" Width="200"/>
            <TextBlock Text="Number of vertical blocks:" />
            <Slider Minimum="1" Maximum="600" Value="{Binding ElementName=pixelateEffect, Path=VerticalBlockCount}" Width="200"/>
        </StackPanel>

        <Border Grid.Row="2" BorderBrush="Black" BorderThickness="1">
            <Border.Effect>
                <effects:PixelateEffect x:Name="pixelateEffect"/>
            </Border.Effect>
            <StackPanel>
                <TextBlock Text="This is some text. Sample text that shows how text can be pixelated." FontSize="24" Background="OliveDrab"/>
                <Button Content="This is a Button." FontSize="36" FontWeight="Bold"/>
                <Border Background="SteelBlue" BorderBrush="Black" BorderThickness="1" Margin="5" Height="40"/>
                <Slider Width="200" Value="5" />
                <Border Height="120">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1.0" StartPoint="0.5,0.0">
                            <GradientStop Color="#FFFF0000" Offset="0"/>
                            <GradientStop Color="#FFFFFF00" Offset="0.166"/>
                            <GradientStop Color="#FF00FF00" Offset="0.333"/>
                            <GradientStop Color="#FF00FFFF" Offset="0.5"/>
                            <GradientStop Color="#FF0000FF" Offset="0.66"/>
                            <GradientStop Color="#FFFF00FF" Offset="0.833"/>
                            <GradientStop Color="#FFFF0000" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
